<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
        function loadDivForm(divId,formId,url){
            if($("#maxQuantity").is(':checked')){
                $("#maxQuantity").val("1")
            }
            if($("#minQuantity").is(':checked')){
                $("#minQuantity").val("1")
            }
            url=url+'?'+$("#"+formId).serialize();
            setTimeout(loadDiv(divId,url),300);
            return false;
        }
</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/csm/expStorageWarning/warning')">消耗品库存预警列表</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                            	<form:form id="searchForm" modelAttribute="expStorageProfile"  onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/csm/expStorageProfile/warning');" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    <div class="form-group"><label>消耗品名称 ：</label><form:input path="expName" htmlEscape="false" maxlength="50" class="form-control" /></div>
                                    &nbsp;&nbsp;<div class="form-group"><label>库存单位 ：</label><form:input path="storageName" htmlEscape="false" maxlength="50" class="form-control" /></div>&nbsp;&nbsp;
                                    <div class="form-group"><label>库存量上限&nbsp;</label><form:checkbox path="maxQuantity" id="maxQuantity" htmlEscape="false" value="null"></form:checkbox></div>&nbsp;&nbsp;
                                        <div class="form-group"><label>库存量下限&nbsp;</label><form:checkbox path="minQuantity" id="minQuantity" htmlEscape="false" value="null"></form:checkbox></div>&nbsp;&nbsp;
                                    <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                </form:form>
                            </div>
                        </div>
                        <table id="contentTable" class="table table-bordered table-striped mg-t datatable">
                            <thead>
                                <tr>
                                        <th>消耗品名称</th>
                                        <th>消耗品编码</th>
                                        <th>库存单位</th>
                                        <th>包装数量</th>
                                        <th>包装规格</th>
                                        <th>包装单位</th>
                                        <th>最小规格</th>
                                        <th>最小单位</th>
                                        <th>供应商</th>
                                        <th>库存量</th>
                                        <th>小包装库存量上限</th>
                                        <th>小包装库存量下限</th>
                                </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="expStorageProfile">
                                <tr>
                                        <td> ${expStorageProfile.expName}</td>
                                        <td> ${expStorageProfile.expCode}</td>
                                        <td> ${expStorageProfile.storageName}</td>
                                        <td> ${expStorageProfile.packageNum}</td>
                                        <td> ${expStorageProfile.packageSpec}</td>
                                        <td> ${expStorageProfile.packageUnits}</td>
                                        <td> ${expStorageProfile.minSpec}</td>
                                        <td> ${expStorageProfile.minUnits}</td>
                                        <td> ${expStorageProfile.supplierJc}</td>
                                        <td> ${expStorageProfile.quantity}</td>
                                        <td> ${expStorageProfile.maxQuantity}</td>
                                        <td> ${expStorageProfile.minQuantity}</td>
                                </tr>
                            </c:forEach>

                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
        </div>
    </div>